import java.io.*;
import java.util.ArrayList;
import java.util.List;

public class ObjectOutputStreamDemo18 {
    public static void main(String[] args) throws IOException {
        WeiBo weiBo = new WeiBo("大家好，我是xck", "2年半的练习生",0);
        WeiBo weiBo1 = new WeiBo("大家好，我是xck", "2年半的练习生",1);
        WeiBo weiBo2 = new WeiBo("大家好，我是xck", "2年半的练习生",2);
        List<WeiBo> weiBos = new ArrayList<>();
        weiBos.add(weiBo);
        weiBos.add(weiBo1);
        weiBos.add(weiBo2);


        FileOutputStream fileOutputStream = new FileOutputStream("C:\\Users\\Administrator\\Desktop\\weibo.data");
        ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream);
        objectOutputStream.writeObject(weiBos);

        objectOutputStream.flush();
        objectOutputStream.close();
    }
}



